export class Japanese {
    name: string = "";
    live: number = 200;
    livelimit:number=200;
    japimg:any=null;
    japdeadimg:any=null;
    japyyimg:any=null;
    speed:number=5;
    x:number=0;
    y:number=0;
    jp_x:number=0;
    jp_y:number=0;
    jpratewidth=30;
    jprateheight=40;
    actionindex=0;


    constructor(_name:string,_live:number,_japimg:any,_japdeadimg:any,_japyyimg:any,_x:number,_y:number,
                _jp_x:number,_jp_y:number,_jpratewidth:number,
                _jprateheight:number) {
        this.name=_name;
        this.live=_live;
        this.japimg=_japimg;
        this.japdeadimg=_japdeadimg;
        this.japyyimg=_japyyimg;
        this.x=_x;
        this.y=_y;
        this.jp_x=_jp_x;
        this.jp_y=_jp_y;
        this.jpratewidth=_jpratewidth;
        this.jprateheight=_jprateheight;
    }

    jpdraw(cptx:any)
    {
        if(this.japimg!=null) {
            cptx.drawImage(this.japimg, 0, 0, this.japimg.width, this.japimg.height, this.x, this.y, this.jpratewidth, this.jprateheight);
        }
    }

    jpdrawshowde=(cptx:any)=>{
        //阴影
        cptx.drawImage(this.japyyimg, 0, 0, this.japyyimg.width, this.japyyimg.height, this.x-5, this.y+this.jprateheight-5, this.jpratewidth+10, this.jprateheight/2-10);
    }

    jpdeaddraw(cptx:any)
    {
        if(this.japdeadimg!=null) {
            cptx.drawImage(this.japdeadimg, 0, 0, this.japdeadimg.width,  this.japdeadimg.height, this.x, this.y+this.jprateheight/2, this.jpratewidth+30, this.jprateheight/2);
        }
    }
}
